package com.example.demo08;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.view.View;

public class TetherPage extends BaseTextPage {

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		
		setHScroll(false);
		
		ConnectivityManager cm = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo[] ns = cm.getAllNetworkInfo();
		if(ns != null) {
			for(NetworkInfo n : ns) {
				appendn("----------------");
				appendn(n.toString());
			}
		}
		
		NetworkInfo an = cm.getActiveNetworkInfo();
		if(an != null)
			append("active:").appendn(an.toString());
		
		update();
	}
}
